<template>
	<view class="appBox">
		<!-- 收益记录 -->
		<view class="syjl">
			<text class="syjl-title">记录明细</text>
			<view class="syjl-item" v-for="(item,index) in accountMoneyList" :key="index">
				<view class="item-left">
					<text class="left-title">{{ item.title }}</text>
					<text class="left-date">{{ item.add_time }}</text>
				</view>
				<view class="item-right">
					<text v-if="item.pm == 0"> - {{ item.number }} </text>
					<text v-else-if="item.pm == 1"> + {{ item.number }} </text>
					<text v-else>{{ item.number }}</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		getJyRecord
	} from "@/api/user";

	export default {
		data() {
			return {
				accountMoneyList: [],
			}
		},
		mounted() {
			//this.getCode();
		},
		onLoad: function(options) {
			this.getJyRecordList()
		},

		methods: {
			async getJyRecordList() {
				let that = this
				uni.showLoading({
					title: '正在加载'
				})
				getJyRecord().then((res) => {
					this.accountMoneyList = res.data.list
					console.log("res1111", res)
					uni.hideLoading()
				}).catch((res) => {
					this.$util.Tips({
						title: res
					});
					uni.hideLoading()
				})
			},
		}

	}
</script>

<style>
	page {
		height: 100%;
	}
</style>
<style lang="scss" scoped>
	.appBox {
		background-color: #F2F6FD;
		height: 100%;
		padding: 16rpx 33rpx;

		.j-bg {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 285rpx;
			width: 100%;
			background: url('/static/images/gold_bg.png') no-repeat;
			background-size: 100% 100%;
			padding: 39rpx 43rpx 31rpx 43rpx;

			.block {
				display: flex;
				flex-direction: column;
				align-items: center;
				color: white;
				font-size: 66rpx;

				.txt {
					font-size: 28rpx;
				}
			}

		}

		.syjl {
			.syjl-title {
				width: 120px;
				font-family: PingFang SC;
				font-weight: 400;
				font-size: 30rpx;
				color: #333333;
				margin-top: 33rpx;
				display: block;
			}

			.syjl-item {
				display: flex;
				justify-content: space-between;
				height: 114rpx;
				padding: 18rpx 22rpx 15rpx 21rpx;
				background: #fff;
				margin-top: 18rpx;

				.item-left {
					display: flex;
					flex-direction: column;
					justify-content: space-between;

					.left-title {
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 26rpx;
						color: #333333;
					}

					.left-date {
						font-family: PingFang SC;
						font-weight: 400;
						font-size: 22rpx;
						color: #999999;
						line-height: 30rpx;
					}
				}

				.item-right {
					color: #EA6D07;
					font-size: 26rpx;
				}
			}
		}
	}


	page {
		background-color: #fff !important;
	}
</style>